package com.junsi.util;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 这是一个用于加载application的工具类--单例模式
 * @author wkp
 *
 */
public class BeanFactoryUtil {
	
	public static BeanFactory factory = null;
	
	private BeanFactoryUtil(){
		
	}
	
	public static BeanFactory getBeanFactory(){
		
		if(factory == null){
			factory = new ClassPathXmlApplicationContext("applicationContext.xml");
		}
		return factory;
	}
}
